{$CLEO .cs}

script_name 'A346W'
wait 50
14@ = Audiostream.Load3D("CLEO\PLANE\WINGS.MP3")
wait 50
goto @A346W_60

:A346W_60
wait 0
if and
  Player.Defined($PLAYER_CHAR)
  Actor.DrivingVehicleType($PLAYER_ACTOR, 577)
goto_if_false @A346W_60
0@ = Actor.CurrentCar($PLAYER_ACTOR)
get_car_speed 2@ = car 0@
get_car_roll 5@ = car 0@
get_car_pitch 6@ = car 0@
Car.StorePos(0@, 21@, 22@, 15@)
get_water_height_at_coords 21@ 22@ ignore_waves 0 store_to 16@
16@ += 15.0
if and
  is_car_in_air_proper 0@
  2@ >= 10.0
goto_if_false @A346W_60
get_position_of_analogue_sticks 0 direction_offset_to 31@ 11@ TIMERA TIMERB
if and
  11@ >= 120
  6@ >= 20.0
  300.0 >= 6@
:A346W_420
if and
  2@ >= 50.0
  51.5 >= 2@
goto_if_false @A346W_815
wait 0
get_car_speed 4@ = car 0@
if 
  not is_float_lvar_greater_or_equal_to_float_lvar 2@ >= 4@
goto_if_false @A346W_815
Audiostream.LinkToCar(14@, 0@)
Camera.Shake(0)
create_fx_system_on_car 10@ = attach_particle "BSBHYDRA" to_car 0@ with_offset 6.2 -4.6 6.1 type 1
play_fx_system 10@
play_and_kill_fx_system 10@
Audiostream.PerformAction(14@, AudioStreamState.Play)
wait 0
create_fx_system_on_car 10@ = attach_particle "BSBHYDRA" to_car 0@ with_offset 10.0 -6.4 6.4 type 1
play_fx_system 10@
play_and_kill_fx_system 10@
wait 0
create_fx_system_on_car 10@ = attach_particle "BSBHYDRA" to_car 0@ with_offset 13.3 -8.2 6.6 type 1
play_fx_system 10@
play_and_kill_fx_system 10@
wait 0
create_fx_system_on_car 10@ = attach_particle "BSBHYDRA" to_car 0@ with_offset -6.2 -4.6 6.1 type 1
play_fx_system 10@
play_and_kill_fx_system 10@
wait 0
create_fx_system_on_car 10@ = attach_particle "BSBHYDRA" to_car 0@ with_offset -10.0 -6.4 6.4 type 1
play_fx_system 10@
play_and_kill_fx_system 10@
wait 0
create_fx_system_on_car 10@ = attach_particle "BSBHYDRA" to_car 0@ with_offset -13.3 -8.2 6.6 type 1
play_fx_system 10@
play_and_kill_fx_system 10@
wait 0
Audiostream.PerformAction(14@, AudioStreamState.Stop)
goto @A346W_60

:A346W_815
if and
  is_float_lvar_greater_or_equal_to_float_lvar 16@ >= 15@
  15@ >= 0.0
goto_if_false @A346W_60
get_offset_from_car_in_world_coords -12@ -13@ TIMERB from_car 0@ with_offset -10.0 -11.4 1.5
get_offset_from_car_in_world_coords -22@ -23@ TIMERB from_car 0@ with_offset 10.0 -11.4 1.5
get_offset_from_car_in_world_coords -2@ -3@ TIMERB from_car 0@ with_offset -10.0 -11.4 1.5
16@ += -17.5
create_fx_system 10@ = create_particle "WATER_SB" at 12@ 13@ 16@ type 1
create_fx_system 11@ = create_particle "WATER_SB" at 22@ 23@ 16@ type 1
play_fx_system 10@
play_fx_system 11@
play_and_kill_fx_system 10@
play_and_kill_fx_system 11@
goto @A346W_60
